/**
 * @description lib/dcf-url
 *
 * @author xiaomi
 */
'use strict';

const Url = require('url');
const lodash = require('lodash');

module.exports = {
    Url: Url.Url,
    parse: Url.parse,
    format(obj) {
        obj = lodash.defaults(obj, {
            protocol: 'http:',
            hostname: process.env.WWW_HOST
        });

        return Url.format(obj);
    }
};
